<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>面板</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <link href="/static/public/libs/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/public/libs/editormd/css/editormd.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/static/public/libs/layui-v2.5.6/layui/css/layui.css">
    <link href="/static/admin/static/css/main.css" rel="stylesheet"/>
    <link href="/static/admin/pages/article/css/article_create.css" rel="stylesheet"/>
</head>
<body class="layui-layout-body">
<div class="p-container">
    <div class="layui-row">
        <form class="layui-form" action="">
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md8">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-input-inline"  style="display: none;">
                            <select lay-verify="" type="hidden"></select>
                        </div>
                        <div class="layui-form-item">
                            <span class="p-form-tip">标题: </span>
                            <input type="text" name="title" required lay-verify="required" placeholder="请输入文章标题"
                                   autocomplete="off" class="layui-input">
                        </div>

                        <div class="layui-form-item" style="margin: 0">
                            <span class="p-form-tip">文章内容:</span>
                        </div>
                        <div id="editorBox">
                            <div id="editor"></div>
                        </div>
                        <textarea name="content" id="mdContent" style="display: none"></textarea>
                    </div>
                </div>

            </div>
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md4 p-container-right">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <div class="p-article-btn-box">
                            <button type="button" lay-submit lay-filter="publishForm"
                                    class="layui-btn layui-btn-normal">发布
                            </button>
                            #if(loginUser.role.code != "contribute")
                            <button type="button" lay-submit lay-filter="draftForm" class="layui-btn layui-btn-primary">
                                保存到草稿箱
                            </button>
                            #end
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form-item">
                            <span class="p-form-tip">分类:</span>
                            <div id="category"></div>
                        </div>

                        <div class="layui-form-item">
                            <span class="p-form-tip">标签:</span>
                            <div id="tag"></div>
                        </div>

                        <div class="layui-form-item">
                            <span class="p-form-tip">文章摘要:</span>
                            <textarea name="summary" placeholder="请输入文章摘要" class="article-textarea layui-textarea"
                                      style="resize: none"></textarea>
                        </div>

                        <div class="layui-form-item">
                            <span class="p-form-tip">SEO关键字:</span>
                            <input type="text" name="metaKeywords" placeholder="请输入SEO关键字" autocomplete="off"
                                   class="layui-input">
                        </div>

                        <div class="layui-form-item">
                            <span class="p-form-tip">SEO描述:</span>
                            <textarea name="metaDescription" placeholder="请输入SEO描述"
                                      class="layui-textarea article-textarea" style="resize: none"></textarea>
                        </div>

                        #if(loginUser.role.code == "contribute")
                        <div class="layui-form-item article-switch" style="display: none">
                            <span class="p-form-tip">允许评论:</span>
                            <input type="checkbox" name="isComment" lay-text="允许|不允许" lay-skin="switch" checked>

                            <span class="p-form-tip">置顶:</span>
                            <input type="checkbox" name="isTop" lay-text="置顶|不置顶" lay-skin="switch">
                        </div>
                        #else
                        <div class="layui-form-item article-switch">
                            <span class="p-form-tip">允许评论:</span>
                            <input type="checkbox" name="isComment" lay-text="允许|不允许" lay-skin="switch" checked>

                            <span class="p-form-tip">置顶:</span>
                            <input type="checkbox" name="isTop" lay-text="置顶|不置顶" lay-skin="switch">
                        </div>
                        #end


                        <div class="layui-form-item">
                            <span class="p-form-tip">缩略图:</span>
                            <div class="p-upload-box" id="thumbnail">
                                <input type="hidden" name="thumbnail">
                            </div>
                        </div>
                        <input type="hidden" name="type" value="article">
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="/static/public/libs/jquery/jquery-3.5.1.min.js"></script>
<script src="/static/public/libs/editormd/editormd.js"></script>
<script src="/static/public/libs/layui-v2.5.6/layui/layui.all.js"></script>
<script src="/static/public/js/main.js"></script>
<script src="/static/admin/pages/article/js/article_create.js"></script>
</body>
</html>